import config from '@/config'
import http from '@/utils/request'

export default {
	org: {
		list: {
			url: `${config.API_URL}/org/list`,
			name: '获取组织树',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		add: {
			url: `${config.API_URL}/org/add`,
			name: '创建组织',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		edit: {
			url: `${config.API_URL}/org/edit`,
			name: '编辑组织',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		delete: {
			url: `${config.API_URL}/org/delete`,
			name: '删除组织',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		enable: {
			url: `${config.API_URL}/org/enable`,
			name: '启停组织',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		}
	},

	user: {
		list: {
			url: `${config.API_URL}/basic/user/list`,
			name: '获取用户列表',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},

		userList: {
			url: `${config.API_URL}/teachingAffairs/teacher/staffList`,
			name: '获取部门用户',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		addRole: {
			url: `${config.API_URL}/basic/user/power`,
			name: '给用户新增角色',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		add: {
			url: `${config.API_URL}/basic/user/add`,
			name: '新增用户',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		enable: {
			url: `${config.API_URL}/basic/user/enable`,
			name: '更新用户状态',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		restPwd: {
			url: `${config.API_URL}/basic/user/restPwd`,
			name: '密码重置',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		update: {
			url: `${config.API_URL}/basic/user/update`,
			name: '更新用户信息',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		}
	},

	role: {
		list: {
			url: `${config.API_URL}/basic/role/list`,
			name: '根据部门id获取角色列表',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		opsList: {
			url: `${config.API_URL}/basic/role/opsList`,
			name: '获取所有角色列表',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		add: {
			url: `${config.API_URL}/basic/role/add`,
			name: '新增角色',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		edit: {
			url: `${config.API_URL}/basic/role/edit`,
			name: '修改角色',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		delete: {
			url: `${config.API_URL}/basic/role/delete`,
			name: '删除角色',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		addRole: {
			url: `${config.API_URL}/basic/role/power`,
			name: '新增角色',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		permission: {
			url: `${config.API_URL}/basic/role/setPower`,
			name: '设置角色权限',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		getPowerById: {
			url: `${config.API_URL}/basic/role/powerByRoleId`,
			name: '通过角色找到它的权限数据',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		}
	},

	power: {
		add: {
			url: `${config.API_URL}/basic/power/add`,
			name: '新增权限',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		edit: {
			url: `${config.API_URL}/basic/power/update`,
			name: '修改权限',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		list: {
			url: `${config.API_URL}/basic/power/list`,
			name: '权限列表',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		},
		del: {
			url: `${config.API_URL}/basic/power/delete`,
			name: '批量删除权限',
			post: async function (params) {
				return await http.post(this.url, params)
			}
		}
	}
}
